using UnityEngine;
using System.Collections;

public class PlayerFallingState : State<PlayerControl>
{
    #region Singleton

    public static PlayerFallingState Instance = new PlayerFallingState();
    private PlayerFallingState() { }

    #endregion

    #region State

    public override void OnEnterState(PlayerControl behaviour)
    {
        behaviour.targetSpeed = Vector3.zero;
        //behaviour.gameObject.renderer.material.color = Color.grey;
    }

    public override void OnUpdateState(PlayerControl behaviour)
    {
        // Fall
        //behaviour.Move(true, 1.0f);

        // Hang

        // Idle
        if (behaviour.characterController.isGrounded)
        {
            behaviour.State = PlayerIdleState.Instance;
            return;
        }
    }

    public override void OnFixedUpdateState(PlayerControl behaviour)
    {
    }

    public override void OnExitState(PlayerControl behaviour)
    {
    }

    public override void OnCollisionState(PlayerControl behaviour, Collision other)
    {
    }

    public override void OnTriggerState(PlayerControl behaviour, Collider other)
    {
  
    }

    #endregion
}
